/**
 * Created by zby on 2018/3/25.
 */
public class Example5_3 {
    public static void main(String[] args) {
        CheapGoods cheapGoods = new CheapGoods();
        //cheapGoods.weight=198.98; 非法，因为子类的weight是int
        cheapGoods.newSetWeight(198);
        System.out.println("对象cheapCoods的weight的值是：" + cheapGoods.weight);
        System.out.println("cheapGoods用子类新增的优惠方法计算价格：" + cheapGoods.newGetWeight());
        cheapGoods.oldSetWeight(198.987);
        System.out.println("cheapGoods使用继承的方法（无优惠）计算价格" + cheapGoods.oldGetPrice());
    }
}
